
<template>
  <div>
    <basic-container>
      <div class="khgl_menu">
        <div class="khgl-header">

          <el-tag type="danger">档案编号: {{cust.dnbh==''||cust.dnbh==undefined?'暂无信息':cust.dnbh}}</el-tag>
          <el-tag>姓名:{{cust.name==''||cust.name==undefined?'暂无信息':cust.name}}</el-tag>
          <el-tag type='info'>手机号: {{cust.brdh==''||cust.brdh==undefined?'暂无信息':cust.brdh}}</el-tag>
          <el-tag type="warning">年龄: {{cust.age==''||cust.age==undefined?'暂无信息':cust.age}}</el-tag>
          <el-tag type="warning">性别: {{cust.xb==''||cust.xb==undefined?'暂无信息':cust.xb==1?'男':'女'}}</el-tag>
          <el-tag type="success">证件号: {{cust.sfzh==''||cust.sfzh==undefined?'暂无信息':cust.sfzh}}</el-tag>
          <el-button @click="breaks" size="small" class="break">
            <i></i>返回</el-button>
        </div>
        <el-tabs v-model="activeName" @tab-click="tabchange">
          <el-tab-pane name="jbxx">
            <span slot="label">
              <i class="icon-jibenziliao_huaban">&nbsp;</i>居民基础档案</span>
          </el-tab-pane>
          <el-tab-pane name="jws">
            <span slot="label">
              <i class="icon-jibenziliao_huaban">&nbsp;</i>居民既往史</span>
          </el-tab-pane>
        </el-tabs>
      </div>
      <router-view class="khgl_content"></router-view>
    </basic-container>
  </div>
</template>

<script>
import { getStore } from '@/util/store'
export default {
  data() {
    return {
      activeName: 'main',
      cust: {}
    }
  },
  created() {
    this.cust =
      getStore({ name: 'cust' }) == null ? {} : getStore({ name: 'cust' })
    this.$router.push({
      path: `/cust/header/jbxx`,
      query: this.$route.query,
      replace: true
    })
  },
  mounted() {},
  methods: {
    breaks() {
      this.$router.push(`/cust/base`)
    },
    tabchange(tab, event) {
      this.$router.push({
        path: `/cust/header/${tab.name}`,
        query: this.$route.query,
        replace: true
      })
    }
  },
  computed: {},
  props: []
}
</script>

<style lang="scss" scoped>
.khgl-header {
  position: relative;
  width: 100%;
  padding: 0 0 5px 0;
  background: #fff;
  box-sizing: border-box;
  .el-tag {
    margin-right: 10px;
  }
}
.khgl_menu {
  padding: 10px 15px 0 15px;
  background: #fff;
  box-sizing: border-box;
}
.khgl_content {
  background: #fff;
  box-sizing: border-box;
  margin: 0 9px 30px 9px;
}
.break {
  position: absolute;
  top: 0;
  right: 0;
  letter-spacing: 2px;
  font-size: 14px;
  color: #20a0ff;
  cursor: pointer;
  z-index: 2;
}
.break:hover {
  color: #333;
}
</style>
